package com.symria.server.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * IosChannelConfig entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "IOS_CHANNEL_CONFIG")
public class IosChannelConfig implements java.io.Serializable {


	// Fields
	private Integer userId;
	private String channel;
	private String channelName;
	private String idfa;
	private String mac;
	private String appId;
	private String callBack;
	private String status;
	private String activateUrl;
	private Integer rate;
	// Constructors

	/** default constructor */
	public IosChannelConfig() {
	}

	/** minimal constructor */
	public IosChannelConfig(Integer userId) {
		this.userId = userId;
	}

	/** full constructor */
	public IosChannelConfig(Integer userId, String channel, String idfa,
			String mac, String appId, String callBack, String status,
			String activateUrl) {
		this.userId = userId;
		this.channel = channel;
		this.idfa = idfa;
		this.mac = mac;
		this.appId = appId;
		this.callBack = callBack;
		this.status = status;
		this.activateUrl = activateUrl;
	}

	// Property accessors
	@Id
	@Column(name = "USER_ID", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "CHANNEL", length = 32)
	public String getChannel() {
		return this.channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	@Column(name = "IDFA", length = 32)
	public String getIdfa() {
		return this.idfa;
	}

	public void setIdfa(String idfa) {
		this.idfa = idfa;
	}

	@Column(name = "MAC", length = 32)
	public String getMac() {
		return this.mac;
	}

	public void setMac(String mac) {
		this.mac = mac;
	}

	@Column(name = "APP_ID", length = 32)
	public String getAppId() {
		return this.appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	@Column(name = "CALL_BACK", length = 32)
	public String getCallBack() {
		return this.callBack;
	}

	public void setCallBack(String callBack) {
		this.callBack = callBack;
	}

	@Column(name = "STATUS", length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "ACTIVATE_URL", length = 256)
	public String getActivateUrl() {
		return this.activateUrl;
	}

	public void setActivateUrl(String activateUrl) {
		this.activateUrl = activateUrl;
	}
	@Formula("(SELECT ui.REAL_NAME FROM USER_INFO ui WHERE ui.USER_ID=USER_ID)")
	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public Integer getRate() {
		return rate;
	}

	public void setRate(Integer rate) {
		this.rate = rate;
	}
}